<nc-component v-bind:data="data[index]" v-bind:class="['rubik-cube']">

	<template slot="preview">
	
		<template v-if="nc.list.length>0 && !nc.list[0].imageUrl">
			<div class="tip">点击编辑魔方</div>
		</template>

		<template v-if="(nc.selectedTemplate != 'custom-rubik-cube')">
		<ul>
			<li v-for="item in nc.list" v-bind:class="nc.selectedTemplate">
				<template v-if="item.imageUrl!=''">
					<img v-bind:src="changeImgUrl(item.imageUrl)">
				</template>
			</li>
		</ul>
		</template>

		<template v-else>
			<template v-if="nc.lazyLoad">
				<rubik-cube-diy-html v-bind:diy-html="nc.diyHtml"></rubik-cube-diy-html>
			</template>
		</template>
		
	</template>
	
	<template slot="edit">
	
		<template v-if="nc.lazyLoad">
			<rubik-cube></rubik-cube>
		</template>
		
	</template>
	
	<!-- 资源 -->
	<template slot="resource">
		
		<js>
		var RESOURCEPATH = "RESOURCE_PATH";
		</js>
		<css src="RESOURCE_PATH/component/view/rubik_cube/css/design.css"></css>
		<js src="RESOURCE_PATH/component/view/rubik_cube/js/design.js"></js>
		
	</template>
	
	<template slot="verify">
		function verify(){
			var res = { code : true, message : "test" };
			
			if(vue.data[{{index}}].selectedTemplate == "custom-rubik-cube"){
				//自定义魔方，不能有空缺
				var customRubikCubeArray = new Array();
				var selectedCount = 0;//选择数量
				
				for(var i=0;i < vue.data[{{index}}].customRubikCube;i++){
					
					for(var j=0;j &lt;vue.data[{{index}}].customRubikCube;j++){
						customRubikCubeArray.push((i+1) + ":" + (j+1));
					}
				}
				
				for(var i=0;i &lt; vue.data[{{index}}].customRubikCube;i++){
					
					for(var j=0;j &lt;vue.data[{{index}}].customRubikCube;j++){
						customRubikCubeArray.push((i+1) + ":" + (j+1));
					}
				}
				
				for(var i=0;i &lt; customRubikCubeArray.length;i++){
					for(var j=0;j &lt; vue.data[{{index}}].selectedRubikCubeArray.length;j++){
						var selectedCoordinates = vue.data[{{index}}].selectedRubikCubeArray[j].selectedCoordinates;
						for(var k=0;k &lt; selectedCoordinates.length;k++){
							if(customRubikCubeArray[i] == selectedCoordinates[k]){
								selectedCount++;
							}
						}
					}
				}
				
				if(selectedCount != customRubikCubeArray.length){
					res.code = false;
					res.message = "自定义魔方必须填满，不能有空缺哦";
				}
				
			}
			
			for(var i=0;i &lt; vue.data[{{index}}].list.length;i++){
				var item = vue.data[{{index}}].list[i];
				if(!item.imageUrl){
					res.code = false;
					res.message = "请上传图片";
					break;
				}
			}
			
			return res;
		}
	</template>

</nc-component>